1 # Visualize the wave functions of a quantum well.
2 # This is a realization (with adaptations and corrections) of the application note alpaca_22 from https://analogparadigm.com.
3 # Schrödinger's equation is here to psi'' = -(U0+epsilon)*psi
5 coefficient(1): +1 -> l # left boundary of quantum well
6 coefficient(2): -1 -> r # right boundary of quantum well
7 coefficient(3): +1 -> +U0 # depth of quantum well
8 coefficient(4): +1 -> epsilon # energy of system
9 coefficient(5): +1 -> psi'0
10 coefficient(6): -1 -> -psi0
11 coefficient(8): -1 -> slowing_t # slowing down t
13 # First, generating a time ramp from -1 to +1
14 iintegrate slowing_t -> t
17 # Defining the boundaries of the quantum well
18 compare t, l -> well_left
19 GT0: -U0 # LT0 is open, thus =0
21 LT0: well_left # GT0 is open, thus =0
23 # adding epsilon to the well and calculating the wave function
24 isum epsilon, well -> -(well+epsilon)
25 multiply -(well+epsilon), psi -> -(well+epsilon)*psi
26 iintegrate -(well+epsilon)*psi -> -psi' # input is psi''
28 iintegrate -psi' -> psi
31 multiply psi, psi -> psi^2
37 output(u): t # also used as trigger